<?php /* Smarty version Smarty-3.1.12, created on 2013-04-12 12:08:16
         compiled from "C:\wamp\www\cm\templates\tasks\list.tpl" */ ?>
<?php /*%%SmartyHeaderCode:23795167f930a78fa5-20112785%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '117815b5d2903346e7f612d434d46a9b2e59468e' => 
    array (
      0 => 'C:\\wamp\\www\\cm\\templates\\tasks\\list.tpl',
      1 => 1365767106,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '23795167f930a78fa5-20112785',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'data' => 0,
    'responsible' => 0,
    'client' => 0,
    'filter' => 0,
    'value' => 0,
    'task' => 0,
    'counter' => 0,
    'bgClass' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_5167f930e2d752_26933097',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5167f930e2d752_26933097')) {function content_5167f930e2d752_26933097($_smarty_tpl) {?><script type="text/javascript">
    
        $(document).ready(function() {
            $("#fulltext").keyup(function(event){
                if(event.keyCode == 13){
                    setFulltext($('#fulltext').val(),'list_of_tasks_fulltext')
                }
            });
            $("#fulltext").focus();
        });
    
</script>
<h2 class="pageTitle">List of tasks</h2>
<?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<div class="menu-list">
    Fulltext search: <input id="fulltext" type="text" value="<?php if ($_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?><?php echo $_smarty_tpl->tpl_vars['data']->value['currentFulltext'];?>
<?php }?>" /><input value="Search" type="button" onclick="setFulltext($('#fulltext').val(),'list_of_tasks_fulltext')" />
    Responsible/Worker filter: 
    <select size="1" onchange="filter('responsible_or_worker',this.value,'list_of_tasks_filter')">
        <option value="-1">-</option>
        <?php  $_smarty_tpl->tpl_vars['responsible'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['responsible']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['responsibles']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['responsible']->key => $_smarty_tpl->tpl_vars['responsible']->value){
$_smarty_tpl->tpl_vars['responsible']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['responsible']->key;
?>
            <option <?php if ($_SESSION['list_of_tasks_filter']['responsible']==$_smarty_tpl->tpl_vars['responsible']->value['users_id']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['responsible']->value['users_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['responsible']->value['surname'];?>
, <?php echo $_smarty_tpl->tpl_vars['responsible']->value['name'];?>
</option>
        <?php } ?>
    </select>
    Client: 
    <select size="1" onchange="filter('client',this.value,'list_of_tasks_filter')">
        <option value="">Please select</option>
        <?php  $_smarty_tpl->tpl_vars["client"] = new Smarty_Variable; $_smarty_tpl->tpl_vars["client"]->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['data']->value['clients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars["client"]->key => $_smarty_tpl->tpl_vars["client"]->value){
$_smarty_tpl->tpl_vars["client"]->_loop = true;
?>
            <option <?php if (isset($_SESSION['user']['clientFilter'])&&$_SESSION['user']['clientFilter']==$_smarty_tpl->tpl_vars['client']->value['klient_id']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['client']->value['klient_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['client']->value['name'];?>
</option>
        <?php } ?>
    </select>&nbsp;
</div>
<?php if ($_smarty_tpl->tpl_vars['data']->value['currentFilter']||$_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?>
    <div class="menu-list bgDark">
        <b>Current filter:</b> 
        <ul>
            <?php  $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['value']->_loop = false;
 $_smarty_tpl->tpl_vars['filter'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['currentFilter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value){
$_smarty_tpl->tpl_vars['value']->_loop = true;
 $_smarty_tpl->tpl_vars['filter']->value = $_smarty_tpl->tpl_vars['value']->key;
?>
                <li><?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
 = <i><?php echo $_smarty_tpl->tpl_vars['value']->value;?>
</i> [<a href="javascript: cancelFilter('<?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
','list_of_tasks_filter')" class="baseLink">Cancel</a>]</li>
            <?php } ?>
            <?php if ($_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?>
                <li>Fulltext = <i><?php echo $_smarty_tpl->tpl_vars['data']->value['currentFulltext'];?>
</i> [<a href="javascript: cancelFulltext('list_of_tasks_fulltext')" class="baseLink">Cancel</a>]</li>
            <?php }?>
        </ul>
    </div>
<?php }?>
<table class="list">
    <tr>
        
        <th><a href="javascript: order('title','list_of_tasks_order')">Name <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="title"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('client','list_of_tasks_order')">Client <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="client"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('creator','list_of_tasks_order')">Who add <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="creator"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a><br/><a href="javascript: order('added','list_of_tasks_order')">When add <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="added"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('updater','list_of_tasks_order')">Who update <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="updater"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a><br/><a href="javascript: order('updated','list_of_tasks_order')">When update <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="updated"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('deadline','list_of_tasks_order')">Deadline <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="deadline"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('responsible','list_of_tasks_order')">Responsible <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="responsible"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a><br/><a href="javascript: order('worker','list_of_tasks_order')">Worker <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="worker"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('type','list_of_tasks_order')">Task type <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="type"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        <th><a href="javascript: order('status','list_of_tasks_order')">Status <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="status"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        
        
        
        
    </tr>
    <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);?>
    <?php  $_smarty_tpl->tpl_vars['task'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['task']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['tasks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['task']->key => $_smarty_tpl->tpl_vars['task']->value){
$_smarty_tpl->tpl_vars['task']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['task']->key;
?>
        <?php if ($_smarty_tpl->tpl_vars['task']->value['state']==2){?>
            <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgRed', null, 0);?>
        <?php }elseif($_smarty_tpl->tpl_vars['task']->value['state']==1){?>
            <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgYellow', null, 0);?>
        <?php }else{ ?>
            <?php if ($_smarty_tpl->tpl_vars['counter']->value==1){?>
                <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgDark', null, 0);?>
            <?php }else{ ?>
                <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgLight', null, 0);?>
            <?php }?>
        <?php }?>
        <tr class="<?php echo $_smarty_tpl->tpl_vars['bgClass']->value;?>
">
            <?php if ($_smarty_tpl->tpl_vars['counter']->value==1){?>
                <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(2, null, 0);?>
            <?php }else{ ?>
                <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);?>
            <?php }?>
            
            <td style="width: 285px"><a class="filterLink" href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=edit_task&task=<?php echo $_smarty_tpl->tpl_vars['task']->value['taskId'];?>
"><?php echo $_smarty_tpl->tpl_vars['task']->value['title'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('client','<?php echo $_smarty_tpl->tpl_vars['task']->value['client'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['client_info']['name'];?>
</a></td>
            <td class="center"><a class="filterLink" href="javascript: filter('creator','<?php echo $_smarty_tpl->tpl_vars['task']->value['creator'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['creator_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['task']->value['creator_info']['surname'];?>
</a><br/><a class="filterLink" href="javascript: filter('added','<?php echo $_smarty_tpl->tpl_vars['task']->value['added'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['created_format'];?>
</a></td>
            <td class="center">
                <?php if ($_smarty_tpl->tpl_vars['task']->value['updater_isset']==1){?>
                    <a class="filterLink" href="javascript: filter('updater','<?php echo $_smarty_tpl->tpl_vars['task']->value['updater'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['updater_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['task']->value['updater_info']['surname'];?>
</a><br/><a class="filterLink" href="javascript: filter('updated','<?php echo $_smarty_tpl->tpl_vars['task']->value['updated'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['updated_format'];?>
</a>
                <?php }else{ ?>
                    -
                <?php }?>
            </td>
            <td><a class="filterLink" href="javascript: filter('deadline','<?php echo $_smarty_tpl->tpl_vars['task']->value['deadline'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['deadline_format'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('responsible','<?php echo $_smarty_tpl->tpl_vars['task']->value['responsible'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['responsible_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['task']->value['responsible_info']['surname'];?>
</a><br/>
                <?php if ($_smarty_tpl->tpl_vars['task']->value['worker']!=-1){?>
                    <a class="filterLink" href="javascript: filter('worker','<?php echo $_smarty_tpl->tpl_vars['task']->value['worker'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['worker_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['task']->value['worker_info']['surname'];?>
</a>
                <?php }else{ ?>
                    -
                <?php }?>
            </td>
            <td style="width: 10em"><a class="filterLink" href="javascript: filter('type','<?php echo $_smarty_tpl->tpl_vars['task']->value['type'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['type_info']['type_of_record'];?>
</a></td>
            <td><a class="filterLink" href="javascript: filter('status','<?php echo $_smarty_tpl->tpl_vars['task']->value['status'];?>
','list_of_tasks_filter')"><?php echo $_smarty_tpl->tpl_vars['task']->value['status_info']['stav'];?>
</a></td>
            
            
        </tr>
    <?php } ?>
</table>
<div class="menu-list">
    <span class="pager"><?php echo $_smarty_tpl->tpl_vars['data']->value['pager'];?>
</span>
    Records per page
    <select class="pager" size="1" onchange="changeRecordsPerPage(this.value, 'list_of_tasks_pager')">
        <option <?php if ($_SESSION['list_of_tasks_pager']==20){?>selected="selected"<?php }?> value="20">20</option>
        <option <?php if ($_SESSION['list_of_tasks_pager']==50){?>selected="selected"<?php }?> value="50">50</option>
        <option <?php if ($_SESSION['list_of_tasks_pager']==100){?>selected="selected"<?php }?> value="100">100</option>
    </select>
    
</div><?php }} ?>